package com.leo.csdnspider.pipeline;

import com.leo.csdnspider.dao.BaseInfoDao;
import com.leo.csdnspider.entity.BaseInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import us.codecraft.webmagic.ResultItems;
import us.codecraft.webmagic.Task;
import us.codecraft.webmagic.pipeline.Pipeline;

/**
 * @ClassName: BaseInfoPipeline
 * @Author: Leo
 * @Description: 基础信息
 * @Date: 9/3/2019 10:18 AM
 */
@Repository
public class BaseInfoPipeline implements Pipeline {

    @Autowired
    private BaseInfoDao baseInfoDao;

    @Override
    public void process(ResultItems resultItems, Task task) {
        BaseInfo baseInfo = resultItems.get("baseInfo");
        baseInfoDao.save(baseInfo);
    }
}
